home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5407 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Unable to check calloc`s
  5. Date: Wed, 07 Feb 96 20:38:38 GMT
  6. Organization: none
  7. Message-ID: <823725518snz@genesis.demon.co.uk>
  8. References: <4f2l8a$c98@gail.ripco.com> <4fadmp$t6g@osage.csc.ti.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4fadmp$t6g@osage.csc.ti.com>
  15.            ramli@sislnews.csc.ti.com "C. S. Ramalingam" writes:
  16.  
  17. >When would using calloc be more appropriate than using malloc ?  Is it true
  18. >that the only use for calloc is in initializing integral values to zero ?
  19. >If so, why was a new function, which appears to have very limited used,
  20. >introduced in the first place ?
  21.  
  22. ANSI adopted it because it was widely implemented and used at the time and
  23. it does have some degree of usefulness. I expect calloc was introduced on
  24. systems where all zero bits did represent a float value of 0 and a null
  25. pointer. A language developing without real focus can pick up baggage
  26. like that.
  27.  
  28. You might also ask why gets() is still a part of the language.
  29.  
  30. -- 
  31. -----------------------------------------
  32. Lawrence Kirby | fred@genesis.demon.co.uk
  33. Wilts, England | 70734.126@compuserve.com
  34. -----------------------------------------
  35.